package com.common.dialog;

import android.support.v4.app.FragmentManager;
import android.view.View;

import java.util.List;

import top.limuyang2.customldialog.BottomTextListDialog;
import top.limuyang2.customldialog.IOSMsgDialog;
import top.limuyang2.customldialog.MaterialMsgDialog;
import top.limuyang2.customldialog.adapter.BottomTextListAdapter;

/**
 * 弹框工具
 * @author mrwim
 * @version 1.0
 */
public class MyDialog {
    /**
     * 返回android meterial风格弹框
     * @param manager
     * @param title
     * @param message
     * @param negStr
     * @param negClick
     * @param posStr
     * @param posClick
     * @return
     */
    public static MaterialMsgDialog showMaterialDialog(FragmentManager manager, String title, String message,  String negStr,View.OnClickListener negClick, String posStr, View.OnClickListener posClick) {
       return MaterialMsgDialog.Companion.init(manager).setTitle(title).setMessage(message).setNegativeButton(negStr, negClick).setPositiveButton(posStr, posClick).setCancelableOutside(false);
    }

    /**
     * 返回 ios风格对话框
     * @param manager
     * @param title
     * @param message
     * @param negStr
     * @param negClick
     * @param posStr
     * @param posClick
     * @return
     */
    public static IOSMsgDialog showIOSDialog(FragmentManager manager, String title, String message,String negStr, View.OnClickListener negClick,  String posStr, View.OnClickListener posClick){
        return IOSMsgDialog.Companion.init(manager).setTitle(title).setMessage(message).setNegativeButton(negStr, negClick).setPositiveButton(posStr, posClick).setCancelableOutside(false);
    }

    /**
     * 返回底部选项框
     * @param manager
     * @param onItemClickListener
     * @param list
     * @return
     */
    public static BottomTextListDialog showSheetDialog(FragmentManager manager, BottomTextListAdapter.OnItemClickListener onItemClickListener, List<String> list){
        return  BottomTextListDialog.Companion.init(manager).setOnItemClickListener(onItemClickListener).setTextList(list).setCancelableOutside(true);
    }
}
